home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / DEPOSITO / REmovido / Nave / BlobLander.swf / scripts / frame_4 / PlaceObject2_163_222 / CLIPACTIONRECORD onClipEvent(enterFrame).as
Text File  |  2006-06-13  |  4KB  |  200 lines

  1. onClipEvent(enterFrame){
  2.    if(Key.isDown(37))
  3.    {
  4.       if(_root.petrol > 0)
  5.       {
  6.          dx -= 0.1;
  7.          rot -= 3;
  8.          _root.ship.FireRight.gotoAndPlay("FireOn");
  9.          _root.petrol -= 0.5;
  10.          dim = _root.petrol / 500;
  11.          percentage = 100 * dim;
  12.       }
  13.    }
  14.    if(Key.isDown(39))
  15.    {
  16.       if(_root.petrol > 0)
  17.       {
  18.          dx += 0.1;
  19.          rot += 3;
  20.          _root.ship.FireLeft.gotoAndPlay("FireOn");
  21.          _root.petrol -= 0.5;
  22.          dim = _root.petrol / 500;
  23.          percentage = 100 * dim;
  24.       }
  25.    }
  26.    if(Key.isDown(38))
  27.    {
  28.       if(_root.petrol > 0)
  29.       {
  30.          dy -= 0.3;
  31.          _root.ship.FireBottom.gotoAndPlay("FireOn");
  32.          _root.petrol -= 1;
  33.          dim = _root.petrol / 500;
  34.          percentage = 100 * dim;
  35.       }
  36.    }
  37.    if(_root.transporter.hitTest(_X,_Y + 22,1))
  38.    {
  39.       if(dy > 1.8)
  40.       {
  41.          this.play();
  42.       }
  43.       else if(Math.abs(dx) > 0.9)
  44.       {
  45.          play();
  46.       }
  47.       else
  48.       {
  49.          _X = _X + dx * 1.5;
  50.          _Y = _Y + dy * 1.3;
  51.          dy = 0;
  52.          dx = 0;
  53.          _root.transporter.play();
  54.          if(_root.petrol <= 0)
  55.          {
  56.             _root.blank.play();
  57.          }
  58.       }
  59.    }
  60.    else if(_root.enemy.hitTest(_X - 18,_Y,1))
  61.    {
  62.       this.play();
  63.    }
  64.    else if(_root.enemy.hitTest(_X + 18,_Y,1))
  65.    {
  66.       this.play();
  67.    }
  68.    else if(_root.enemy.hitTest(_X,_Y - 22,1))
  69.    {
  70.       this.play();
  71.    }
  72.    else if(_root.enemy.hitTest(_X,_Y + 24,1))
  73.    {
  74.       this.play();
  75.    }
  76.    else if(_root.ground.hitTest(_X,_Y + 22,1))
  77.    {
  78.       if(dy > 2)
  79.       {
  80.          this.play();
  81.       }
  82.       else if(Math.abs(dx) > 1.3)
  83.       {
  84.          this.play();
  85.       }
  86.       else
  87.       {
  88.          if(dy >= 0.6 && dy <= 1.9 || dx >= 0.4 && dx <= 1.2)
  89.          {
  90.             _root.shields -= 4;
  91.             _root.bang.play();
  92.             trace("shield bottom");
  93.          }
  94.          _X = _X + dx * 1.5;
  95.          _Y = _Y + dy * 1.3;
  96.          dy = 0;
  97.          dx = 0;
  98.          if(_root.petrol <= 0)
  99.          {
  100.             _root.blank.play();
  101.          }
  102.       }
  103.    }
  104.    else if(_root.ground.hitTest(_X,_Y - 24,1))
  105.    {
  106.       if(dy > 1.3)
  107.       {
  108.          this.play();
  109.       }
  110.       else if(Math.abs(dx) > 1.7)
  111.       {
  112.          this.play();
  113.       }
  114.       else
  115.       {
  116.          if(dy >= 0.1 && dy <= 1.2 || dx >= 0.1 && dx <= 1.6)
  117.          {
  118.             _root.shields -= 4;
  119.             _root.bang.play();
  120.             trace("shield top");
  121.          }
  122.          _X = _X + dx * 1.5;
  123.          _Y = _Y + dy * 1.3;
  124.          dy = 1.25;
  125.          dx = 0;
  126.          if(_root.petrol <= 0)
  127.          {
  128.             _root.blank.play();
  129.          }
  130.       }
  131.    }
  132.    else if(_root.ground.hitTest(_X + 16,_Y,1))
  133.    {
  134.       if(dy > 2.8)
  135.       {
  136.          this.play();
  137.       }
  138.       else if(Math.abs(dx) > 2.8)
  139.       {
  140.          this.play();
  141.       }
  142.       else
  143.       {
  144.          if(dy >= 0.1 && dy <= 2.7 || dx >= 0.1 && dx <= 2.7)
  145.          {
  146.             _root.shields -= 4;
  147.             _root.bang.play();
  148.             trace("shield right");
  149.          }
  150.          _X = _X + dx * 1.5;
  151.          _Y = _Y + dy * 1.3;
  152.          dy = 0;
  153.          dx = -1.25;
  154.          if(_root.petrol <= 0)
  155.          {
  156.             _root.blank.play();
  157.          }
  158.       }
  159.    }
  160.    else if(_root.ground.hitTest(_X - 16,_Y,1))
  161.    {
  162.       if(dy > 2.8)
  163.       {
  164.          this.play();
  165.       }
  166.       else if(Math.abs(dx) > 2.8)
  167.       {
  168.          this.play();
  169.       }
  170.       else
  171.       {
  172.          if(dy >= 0.1 && dy <= 2.7 || dx >= 0.1 && dx <= 2.7)
  173.          {
  174.             _root.shields -= 4;
  175.             _root.bang.play();
  176.             trace("shield left");
  177.          }
  178.          _X = _X + dx * 1.5;
  179.          _Y = _Y + dy * 1.3;
  180.          dy = 0;
  181.          dx = 1.25;
  182.          if(_root.petrol <= 0)
  183.          {
  184.             _root.blank.play();
  185.          }
  186.       }
  187.    }
  188.    else
  189.    {
  190.       _X = _X + dx * 1.5;
  191.       _Y = _Y + dy * 1.3;
  192.       dy += 0.07;
  193.       if(_root.ship._y > 400)
  194.       {
  195.          play();
  196.       }
  197.       _rotation = 5 * dx;
  198.    }
  199. }
  200.